package com.itheima.mycollection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;

public class Demo4 {
    public static void main(String[] args) {
        ArrayList<String> list=new ArrayList<>();
        Collections.addAll(list,"a","b","c","d","e");
        Iterator<String> it=list.iterator();
        while(it.hasNext()){
           String temp= it.next();
           if (temp.equals("d")){
               list.remove(temp);
           }
        }
        System.out.println(list);
    }
}
